﻿@model PagedList<SaleListModel>
@{
    ViewBag.Title = "销售列表";
    Layout = "~/Views/Shared/_ContentLayout.cshtml";

    SaleListQueryModel paramModel = new SaleListQueryModel();
    if (ViewBag.paramModel != null)
    {
        paramModel = (SaleListQueryModel)ViewBag.paramModel;
    }
}


<form id="S_Form" class="form-inline definewidth m20" action="@Url.Action("salelist", "finance")" method="get">
    <div class="form_query">
        <div>
            销售日期：
            <input type="text" name="beg_time" class="calendar" id="beg_time" value="@paramModel.beg_time.ToString(2)"> - <input type="text" name="end_time" class="calendar" id="end_time" value="@paramModel.end_time.ToString(2)">&nbsp;
        </div>
        <div>
            @{Html.RenderPartial(Url.Content("~/Views/Common/PageSize.cshtml"), paramModel);}
        </div><div>
            <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp;
        </div>
    </div>
</form>

<table class="table table-bordered table-hover definewidth m10">
    <thead>
        <tr>
            <th>销售日期</th>
            <th>销售金额</th>
            <th>服务费</th>
            <th>推荐费</th>
            <th>操作</th>
        </tr>
    </thead>
    @if (Model != null && Model.Count != 0)
    {
        int index = 0;
        foreach (var m in Model)
        {
            index++;
            <tr class="@HtmlPagerHelper.TrClass(index)">
                <td>@m.sale_date.ToString(6)</td>
                <td>@m.sale_money</td>
                <td>@m.buyer_money</td>
                <td>@m.recommend_money</td>
                <td>
                    <a href="@Url.Action("salesettlementlist", "finance", new { beg_time = m.sale_date.ToString(2),end_time = m.sale_date.ToString(2) })">结算明细</a>
                </td>
            </tr>
        }
    }
</table>
<div class="inline pull-left total">
    总行数：@ViewData["AllCount"] | 总销售金额：@ViewData["AllSaleMoney"] | 总代购金额：@ViewData["AllBuyerMoney"] | 总推荐金额：@ViewData["AllRecommendMoney"]
</div>
<div class="inline pull-right page">
    @if (Model != null)
            {
        @Html.Pager(Model, HtmlPagerHelper.BasePagerOption)
    }
</div>

